<?php

namespace App\Mail;

use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class Welcome extends Mailable
{
    use Queueable, SerializesModels;
    public $user;
    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct(User $user)
    {
        $this->user = $user;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        $from = ['From: from@qq.com','fromman'];
        $to = ['To: to@qq.com','toman'];
        $subject = 'Subject Subject';
        $user = auth()->user();
        return $this->view('email.welcome',compact('user'))
            ->to($to)
            ->from($from)
            ->subject($subject);

        //return $this->view('view.welcome');
    }
}
